package cate.common.table.activity.hangdrop.exchange;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("掉落兑换活动-兑换 Row")
public class HangDropActivityExchangeRow extends ERow {
    @NoteField("分组")
    public int group;
    @NoteField("奖励")
    public String rewardStr;
    @NoteField("兑换消耗")
    public String consumeStr;
    @NoteField("限兑次数")
    public int limit;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        id = xrw.getInteger("ID");
        group = xrw.getInteger("分组");
        rewardStr = xrw.getString("奖励");
        consumeStr = xrw.getString("兑换消耗");
        limit = xrw.getInteger("限兑次数", -1);

        if (consumeStr == null || consumeStr.isEmpty()) {
            getContext().warningOnSheetLoading(parent.parent.getFileName(),
                    parent.getSheetName(),
                    "ID=" + id + " 兑换消耗为空!");
        }

        if (rewardStr == null || rewardStr.isEmpty()) {
            getContext().warningOnSheetLoading(parent.parent.getFileName(),
                    parent.getSheetName(),
                    "ID=" + id + " 奖励为空!");
        }
    }
}
